package com.home.entity.sensor;

import com.home.entity.environment.Environment;
import com.home.subject.Subject;


public class HumiditySensor implements Sensor {
    private float humidity;
    private Subject subject;
    @SuppressWarnings("unused")
    private HumiditySensor() {

    }

    public HumiditySensor(Subject subject) {
        this.subject = subject;
        subject.registerSensor(this);
    }

    public float getHumidity() {
        return humidity;
    }

    public void setHumidity(float humidity) {
        this.humidity = humidity;
    }

    @Override
    public void update(Environment environment) {
        setHumidity(environment.getHumidity());
    }
}
